package 作业;

import java.util.ArrayList;
import java.util.List;

public class Student {
    public static void main(String[] args) {
        List list =new ArrayList();
        list.add(new zuoye2("Tom",18,100,"class05"));
        list.add(new zuoye2("Jerry",22,70,"class04"));
        list.add(new zuoye2("Owen",25,90,"class05"));
        list.add(new zuoye2("Jim",30,80,"class05"));
        list.add(new zuoye2("Steve",28,66,"class06"));
        list.add(new zuoye2("Kevin",24,100,"class04"));
        int g=0;
        int f=0;
        for (int i=0;i<list.size();i++){
            zuoye2 z2= (zuoye2) list.get(i);
            int a=z2.getAge();
            int b=z2.getScore();
            f+=b;
            g+=a;
            System.out.println(a);
        }
        int c=g/6;
        int v=f/6;
        System.out.println("平均年龄："+c);
        System.out.println("平均成绩："+v);
    }
}
